/*
 * @Author: zk
 * @Date: 2021-02-25 17:43:59
 * @LastEditors: zk
 * @LastEditTime: 2021-02-26 11:57:40
 * @Description:
 */

export default {
  beforeMount() {
    window.addEventListener('beforeunload', e => this.$_beforeunloadFn(e))
  },
  beforeDestroy() {
    window.removeEventListener('beforeunload', null, false)
  },
  methods: {
    $_beforeunloadFn(e) {
      e.preventDefault()
      e.returnValue = ''
    }
  }
}
